package org.darcy.framework.model;

import java.io.Serializable;
import java.util.List;

//1.按照JqGrid的格式定义一个bean
public class JqGridData<T> implements Serializable {

	private static final long serialVersionUID = 1L;

	/** 总页数 */
	private long total;
	/** 页码 */
	private long page;
	/** 记录数 */
	private long records;
	/** 数据实体 */
	private List<T> rows;

	public JqGridData() {
	}

	/**
	 * 用于本地jgqrid分页
	 * 
	 * @param rows
	 */
	public JqGridData(List<T> rows) {
		if (rows != null) {
			this.page = 1;
			this.total = 1;
			this.records = rows.size();
			this.rows = rows;
		}

	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

	public long getRecords() {
		return records;
	}

	public void setRecords(Integer records) {
		this.records = records;
	}

	public long getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

}
